/*
•连续输入字符串，请按长度为8拆分每个字符串后输出到新的字符串数组； 
•长度不是8整数倍的字符串请在后面补数字0，空字符串不处理。*/

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stdlib.h>

using namespace std;

int main()
{
    string s1,s2;
    int l1,l2,a1,a2,i,p,q;
    cin>>s1>>s2;
//s1="oswgkjwvstbgfzszdoemlpvtoqeautekdfwpezdfxatvcyskrisiqcjynmtwcfmzzuseyaxanc";
//s2="guwldvzrsfurobidegiyazkggfpgmyhlrbfjrjerrbnjdenrdxjfmrhtumfdsedkcmthphgavzxlmpcpwbkwsvplhmkbkgkw";

    l1=s1.length();a1=l1%8;
    l2=s2.length();a2=l2%8;

    if(l1==0)cout<<s1<<endl;
    else if(a1!=0)for(i=0;i<8-a1;i++)s1+="0";

    for(p = s1.length()-8; p > 0; p-=8)s1.insert(p,"\n");
    cout<<s1<<endl;//break;



    if(l2==0)cout<<s2<<endl;
    else if(a2!=0)for(i=0;i<8-a2;i++)s2+="0";

    for(q = s2.length()-8; q > 0; q-=8)s2.insert(q,"\n");
    cout<<s2<<endl;//break;


     return 0;
}
